Ext.define('passport.trees.Permission', {
    extend: 'Ext.tree.Panel',
    		alias: 'widget.permissionTree',
		    width: '100%',
		    bodyBorder: false,
		    border:1,
		    listeners: {
		        itemclick: function(item, e) {
		        		console.log('a');
		        },
		        dblclick: function(node, e){
		        		console.log('b');
		        }
    		},
    		store:Ext.create('Ext.data.TreeStore', { 
		        proxy: 
		        { 
		            type: 'jsonp', 
		            url: 'http://192.168.1.116/RpcService/Gateway.ashx?module=permission&action=SysGroupTree&method=get' 
		        }
		    }),
		    			 
		    root: {
		    	id:'root',
		        text: '\u6574\u4E2A\u7CFB\u7EDF',
		        expanded: true
		    },
		    initComponent: function() {
		        this.callParent();
		    },
		    listeners:{
		    	itemcontextmenu: function(view,node,item,index,e) {
		    			var contextMenu = new Ext.menu.Menu({
							  items: [
							  {
							    text: 'Create',
							    iconCls: 'edit',
							    action: 'create'
							  },
							  {
							    text: 'Edit',
							    iconCls: 'edit'
							  },
							  {
							    text: 'Delete',
							    iconCls: 'edit',
							  },
							  {
							    text: 'Set inactive',
							    iconCls: 'edit'
							  }
							  ]
							});
							e.stopEvent();
							contextMenu.showAt(e.getX(), e.getY(), true);
		    	}
		    }
})